package com.smart.manage.service.impl;

import java.util.List;
import com.smart.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.manage.mapper.DoctorAppointmentMapper;
import com.smart.manage.domain.DoctorAppointment;
import com.smart.manage.service.IDoctorAppointmentService;

/**
 * 医生预约管理Service业务层处理
 * 
 * @author lingyao
 * @date 2025-03-03
 */
@Service
public class DoctorAppointmentServiceImpl implements IDoctorAppointmentService 
{
    @Autowired
    private DoctorAppointmentMapper doctorAppointmentMapper;

    /**
     * 查询医生预约管理
     * 
     * @param id 医生预约管理主键
     * @return 医生预约管理
     */
    @Override
    public DoctorAppointment selectDoctorAppointmentById(Long id)
    {
        return doctorAppointmentMapper.selectDoctorAppointmentById(id);
    }

    /**
     * 查询医生预约管理列表
     * 
     * @param doctorAppointment 医生预约管理
     * @return 医生预约管理
     */
    @Override
    public List<DoctorAppointment> selectDoctorAppointmentList(DoctorAppointment doctorAppointment)
    {
        return doctorAppointmentMapper.selectDoctorAppointmentList(doctorAppointment);
    }

    /**
     * 新增医生预约管理
     * 
     * @param doctorAppointment 医生预约管理
     * @return 结果
     */
    @Override
    public int insertDoctorAppointment(DoctorAppointment doctorAppointment)
    {
        doctorAppointment.setCreateTime(DateUtils.getNowDate());
        return doctorAppointmentMapper.insertDoctorAppointment(doctorAppointment);
    }

    /**
     * 修改医生预约管理
     * 
     * @param doctorAppointment 医生预约管理
     * @return 结果
     */
    @Override
    public int updateDoctorAppointment(DoctorAppointment doctorAppointment)
    {
        doctorAppointment.setUpdateTime(DateUtils.getNowDate());
        return doctorAppointmentMapper.updateDoctorAppointment(doctorAppointment);
    }

    /**
     * 批量删除医生预约管理
     * 
     * @param ids 需要删除的医生预约管理主键
     * @return 结果
     */
    @Override
    public int deleteDoctorAppointmentByIds(Long[] ids)
    {
        return doctorAppointmentMapper.deleteDoctorAppointmentByIds(ids);
    }

    /**
     * 删除医生预约管理信息
     * 
     * @param id 医生预约管理主键
     * @return 结果
     */
    @Override
    public int deleteDoctorAppointmentById(Long id)
    {
        return doctorAppointmentMapper.deleteDoctorAppointmentById(id);
    }
}
